package modelcontroller;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Mariam
 */
public class User {

    private String username;
    private String hostname;
    private InetAddress IPaddr;

    public User(String username, String hostname) {
        this.username = username;
        this.hostname = hostname;
        try {
            this.IPaddr = InetAddress.getByName(hostname);
        } catch (UnknownHostException ex) {
            Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public String getUsername() {
        return username;
    }

    public String getHostname() {
        return hostname;
    }

    public InetAddress getIPaddr() {
        return IPaddr;
    }

    @Override
    public String toString() {
        return username + "@" + hostname;
    }
}
